import { IMessageBase } from "../../Framework/MQ/IMessageBase";
import { MessageManager } from "../../Framework/MQ/MessageManager";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { EBattlefieldStatus } from "./EBattlefieldStatus";
type int = number;
//class SBattlefieldInfo

export class SBattlefieldInfo extends IMessageBase {
  constructor(autoreg = false) {
    
    super();if (autoreg) {
      MessageManager.instance().regist(this);
    }
    return;
  }

  public /* override */ getType(): int {
    return this._type;
  }

  public /* override */ clone(): IMessageBase {
    return new SBattlefieldInfo();
  }

  public /* override */ __write(arg1: SerializeStream): void {
    arg1.writeInt(this.id);
    this.status.__write(arg1);
    arg1.writeByte(this.num1);
    arg1.writeByte(this.num2);
    arg1.writeByte(this.num3);
    arg1.writeByte(this.maxPlayer);
    return;
  }

  public /* override */ __read(arg1: SerializeStream): void {
    this.id = arg1.readInt();
    this.status = EBattlefieldStatus.__read(arg1);
    this.num1 = arg1.readByte();
    this.num2 = arg1.readByte();
    this.num3 = arg1.readByte();
    this.maxPlayer = arg1.readByte();
    return;
  }

  public /* const */ _type: int = 90;

  public /* var */ id!: int;

  public /* var */ status!: EBattlefieldStatus;

  public /* var */ num1!: int;

  public /* var */ num2!: int;

  public /* var */ num3!: int;

  public /* var */ maxPlayer!: int;

  public static /* var */ _regist: SBattlefieldInfo = new SBattlefieldInfo(
    true
  );
}
